<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      >

<h:form >
<div class="fiche">
<div class="title"><h:outputText value="#{mbSpectacle.spectacleDonnees.nom}"/></div>
<div class="content">
<div class="image"><h:graphicImage url="#{mbSpectacle.photoPath}"/></div>
<div class="description">#{mbSpectacle.spectacleDonnees.description}</div>
</div>

<div class="autres">
 	<div><span>Genre</span>#{mbSpectacle.genreEtAudience}</div>
 	<div><span>Casting</span>#{mbSpectacle.spectacleDonnees.casting}</div> 
 	<div><span>Mise en scène</span>#{mbSpectacle.spectacleDonnees.metteurScene}</div>
 	<div><span>Auteur</span>#{mbSpectacle.spectacleDonnees.auteur}</div>
 	<div><span>Lieu</span>#{mbSpectacle.spectacle.theatre.nomTheatre}</div>	
 	<div><span>Adresse</span>#{mbSpectacle.adresse} #{mbSpectacle.codeEtVille}</div>
</div>

<div class="seances">
	<div class="title">Choisissez votre séance</div>
	<ul>
	<ui:repeat var="seance" value="#{mbSpectacle.seancesVue}">
		<li>
		<span class="date"><h:outputText value="#{seance.dateSeance}">
			<f:convertDateTime locale="fr" pattern="EEE dd MMM yyyy"/>
		</h:outputText></span>
		<span class="heure"><h:outputText value="#{seance.dateSeance}">
			<f:convertDateTime locale="fr" pattern="h:mm"/>
		</h:outputText></span>
		<span class="action"><h:inputText value="#{seance.quantite}" ></h:inputText>
		 <h:commandButton value="Réserver" actionListener="#{mbSpectacle.ajouter}" >
		 	<f:attribute value="#{seance.quantite}" name="quantite"/>
		 	<f:attribute value="#{seance.idSeance}" name="seanceId"/>
		 </h:commandButton>	</span>
		</li>
	</ui:repeat>
	</ul>
</div>						

</div>
</h:form>

</html>